{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "import cv2\n",
    "vc = cv2.VideoCapture(\"/home/xushaocong/exp/deep_motion_mag/data/vids/baby.mp4\")\n",
    "target_file =\"/home/xushaocong/exp/deep_motion_mag/data/vids/baby/%06d.png\"\n",
    "c= 0 \n",
    "rval, frame = vc.read()\n",
    "while rval:\n",
    "    cv2.imwrite(target_file%c, frame)\n",
    "    c += 1\n",
    "    rval, frame = vc.read()\n",
    "    cv2.waitKey(1)\n",
    "vc.release()\n",
    "\n"
   ]
  }
 ],
 "metadata": {
  "interpreter": {
   "hash": "e2be6a09c2ae8062fb5d78cfd88bd1ade4b5113e48e3ad1d470c6f2a4a27ae42"
  },
  "kernelspec": {
   "display_name": "Python 3.6.15 ('deep_motion2')",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.15"
  },
  "orig_nbformat": 4
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
